#ifndef LOCALSETTING_H
#define LOCALSETTING_H

#include <QObject>
#include <QSettings>
#include <QDateTime>

class LocalSetting : public QObject
{
public:
    static LocalSetting* instance();
    static bool isSettingExists();

    QDateTime getLastLoginDatetime();
    void setLastLoginDatetime(const QDateTime& time);

    quint32 getLastLoginFailedCount();
    void setLastLoginFailedCount(quint32 count);

    void removeLastloginDatetimeCount();

    bool getFaceAuthUsed();
    void setFaceAuthUsed(bool used);

    QList<qint32> getFaceLabelsList() const;
    void setFaceLabelsList(const QList<qint32>& labelList);

    QString getFaceDetectFilepath() const;
    QList<QString> getFaceRecogFilepath() const;

    quint32 getLastFaceauthFailedCount();
    void setLastFaceauthFailedCount(quint32 count);

    void removeLastFaceauthDatetimeCount();

private:
    LocalSetting();
    static LocalSetting* ins;
    QSettings* settings;

};

#endif // LOCALSETTING_H
